<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" style="height:100%;">
<head>
<title><spring:message code="login.page.title"/></title>
<link rel="stylesheet" href="<c:url value="/resources/css/reset-min.css"/>" type="text/css" />
<link rel="stylesheet" href="<c:url value="/resources/css/style.css"/>" type="text/css" />
<script type="text/javascript" src="<c:url value="/resources/scripts/jquery-1.6.4.js"/>"></script>
<script type="text/javascript" src="<c:url value="/resources/scripts/myValidate.js"/>"></script>
<!-- IE png bug fix!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!--[if IE 6]>
    <script type="text/javascript" src="<c:url value="/resources/scripts/DD_belatedPNG_0.0.8a-min.js"/>"></script>
    <script type="text/javascript">
        DD_belatedPNG.fix('.png_bg');
    </script>
<![endif]-->
<script type="text/javascript">
$(function(){
	$("#btnOk").click(function(){
		loginFormSubmit();
	});
	
	$("#btnClean").click(function(){
		$("#j_username,#j_password").attr("value","").css("color","#000");
		$("#msgDiv").html("");
	});
});
function loginFormSubmit(){
	var formObj = document.getElementById("loginAccountForm");
	if(!Validator.Validate(formObj,2)){
		return false;
	}else{
		$("#loginAccountForm").submit();
	}
}
function enterSubmit(e){
	if(e.keyCode==13){
		loginFormSubmit();
	}
}
</script>
</head>
<body id="loginBody">
<div id="header">
	<img src="<c:url value="/resources/images/logo.png"/>" />
</div>
<div id="loginBodyWrapper">
	<div id="imgLeft">
		<img src="<c:url value="/resources/images/img_left.png"/>" />
	</div>
	<div id="loginForm" class="png_bg">
		<form action="<c:url value="/j_spring_security_check"/>" method="post" id="loginAccountForm">
			<table>
				<tr>
					<td>用户名：</td>
					<td><input type="text" id="j_username" name="j_username" onkeydown="enterSubmit(event)" /></td>
				</tr>
				<tr>
					<td>密　码：</td>
					<td><input type="password" id="j_password" name="j_password" onkeydown="enterSubmit(event)" /></td>
                </tr>
				<tr>
                    <td colspan="2" style="height:40px;">
                        <div id="msgDiv"><span style="color:red;">${errorMsg}</span></div>
                    </td>
				</tr>
                <tr>
                	<td colspan="2" class="lf_submit">
	                	<input type="button" class="btnSubmit" id="btnOk" />
						<input type="button" class="btnReset" id="btnClean" />
					</td>
				</tr>
			</table>
		</form>
	</div>
</div>
</body>
</html>